﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<AgriculturalMachinery.Models.AccountViewModel<AgriculturalMachinery.Models.Clients>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	铁牛农机后台管理系统: 用户管理
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="operaAera">
    <div id="operaInfo" class="operaInfo" onclick="operaInfoClick();" onmousemove="operaInfoMouseMove();" onmouseout="operaInfoMouseOut();"></div>
    <div id="operaUsers" class="operaUsers" onclick="operaUsersClick();" onmousemove="operaUsersMouseMove();" onmouseout="operaUsersMouseOut();"></div>        
    <div id="operaStorage" class="operaStorage" onclick="operaStorageClick();" onmousemove="operaStorageMouseMove();" onmouseout="operaStorageMouseOut();"></div>
    <div id="operaQuit" class="operaAeraQuit"></div>
</div>
<div class="operaContent">
    <div class="operaContentDelChk" onclick="delAllUser();">删除选中</div><hr />
    <table class="operaContentTable">
        <tr class="operaContentTableTitle">
            <td><input type="checkbox" onclick="clientSelectAll();"/></td>
            <td>ID</td>
            <td>用户名</td>
            <td>联系方式</td>
            <td>E-mail</td>
            <td>用户密码</td>
            <td>注册日期</td>
            <%--<td>用户头像</td>--%>
            <td>是否删除</td>
        </tr>
        <%foreach (AgriculturalMachinery.Models.Clients c in Model.QueryClient) %>
        <%{ %>
            <%--因为是管理员登录, 故不用判断删除标志, 但是要判断是是否是admin本身--%>
            <%if (!c.UserName.Equals("admin"))%>
            <%{ %>
            <tr>
                <td><input type="checkbox"  class="ck" name="ck" id="<%=c.UserID%>"/></td>
                <td><%=c.UserID%></td>
                <td><%=c.UserName%></td>
                <td><%=c.Contact%></td>
                <td><%=c.Email%></td>
                <td><%=c.Password%></td>
                <td><%=c.RegDate%></td>
                <%--<td><img alt="<%=c.Avatar%>" src="../Avatar/<%=c.Avatar%>" /></td>--%>
                <td><a href="/Account/Delete/<%=c.UserID%>">点击删除</a></td>
            </tr>
            <%} %>
        <%} %>
        <tr>
            <td></td>
            <td></td>
            <td><input type="text" style="width: 77px;" id="UserName"/></td>
            <td><input type="text" style="width: 77px;" id="Contact"/></td>
            <td><input type="text" style="width: 77px;" id="Email"/></td>
            <td><input type="text" style="width: 77px;" id="clientPassword"/></td>
            <td><input type="text" style="width: 77px;" id="regDate"/></td>
            <%--<td><input type="button" style="width: 77px;" id="Avatar" value="上传"/></td>--%>
            <td><div onclick="addClient(UserName.value, Contact.value, Email.value, clientPassword.value, regDate.value);"> &nbsp;&nbsp;
            添加</div></td>
        </tr>
    </table>
    <%if (Model.AccountHasPreviousPage) %>
    <%{ %>
        <div id="fenyeLeft" class="fenyeLeft" onmousemove="fenyeLeftMouseMove();" onmouseout="fenyeLeftMouseOut();"
                onclick="AccountFenyeLeft(<%=Model.AccountPageIndex - 1 %>);"></div>
    <%} %>
    <%if (Model.AccountHasNextPage) %>
    <%{ %>
    <div id="fenyeRight" class="fenyeRight" onmousemove="fengyeRightMouseMove();" onmouseout="fenyeRightMouseOut();"
                onclick="AccountFenyeRight(<%=Model.AccountPageIndex + 1%>);"></div>
    <%} %>
</div>
<script type="text/javascript" src="../../Scripts/AccountManager.js"></script>
</asp:Content>
